package cn.wolfcode.crm.query;

import com.alibaba.druid.util.StringUtils;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Getter  @Setter
public class SigninQueryObject extends QueryObject{
    private String keywords;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date beginDate;

    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd")   // HH:mm:ss
    private Date endDate;

    private Long deptId;

    public String getKeywords(){
        /*if (StringUtils.isEmpty(keywords)){
            return null;
        }
        return keywords;*/

        return StringUtils.isEmpty(keywords) ? null : keywords;
    }
}
